package com.lut.dao.impl;

import com.lut.dao.UserDao;
import com.lut.pojo.User;
import com.lut.service.UserService;

/**
 * @user:dell
 * @date:2020年09月25 22:18
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao=new UserDaoImpl();
    @Override
    public void registUser(User user) {
        userDao.saveUser(user);

    }

    @Override
    public User login(User user) {
        return userDao.queryUserByUsernameAndPassword(user.getUsername(),user.getPassword());
    }

    @Override
    public boolean existUsername(String username) {
        if(userDao.queryUserByUsername(username)==null){
            return false;
        }
        return true;
    }
}
